﻿@using NetCore.Model;
@{

    ViewData["Title"] = "编号 管理";

}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content text-center p-md ibox-content-search">
                    <form class="form-horizontal" datatable="tableGrid">
                        <div class="form-group col-md-4">
                            <label for="keyWord" class="col-md-3 control-label text-right">关键字</label>
                            <div class="col-md-9">
                                <input id="keyWord" name="keyWord" class="form-control" placeholder="关键字" />
                            </div>
                        </div>

                        <div>

                            <a class="btn  btn-danger  pull-right btn-rounded btn-outline btn-delete"><i class="fa fa-trash"></i>删  除</a>
                            <label class="pull-right">   </label>
                            <a class="btn  btn-primary pull-right btn-rounded btn-outline" asp-action="Edit"><i class="fa fa-plus"></i>新  增</a>
                            <label class="pull-right">   </label>
                            <a class="btn btn-primary pull-right btn-rounded  btn-search"><i class="fa fa-search"></i>搜  索</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content text-center p-md">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover dataTables" id="tableGrid">
                            <thead>
                                <tr>
                                    <td>
                                        <div class="i-checks">
                                            <label> <input type="checkbox" class="thead checkall" title="全选" /></label>
                                        </div>
                                    </td>
                                    <td> 编号</td>
                                    <td> 描述</td>
                                    <td> 前缀</td>
                                    <td> 后缀</td>
                                    <td> 长度</td>
                                    <td> 计数器</td>
                                    <td> 修改时间</td>
                                    <td>操作</td>
                                </tr>

                            </thead>

                            <tfoot>

                                <tr>
                                    <td>
                                        <div class="i-checks">
                                            <label> <input type="checkbox" class="tfoot checkall" title="全选" /></label>
                                        </div>
                                    </td>
                                    <td> 编号</td>
                                    <td> 描述</td>
                                    <td> 前缀</td>
                                    <td> 后缀</td>
                                    <td> 长度</td>

                                    <td> 计数器</td>
                                    <td> 修改时间</td>
                                    <td>操作</td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@section scripts{
    <script type="text/javascript">

        $(document).ready(function () {
                var table = $(".dataTables").CustomForm({
                    isValidate: false,
                    isTable: true,
                    "order": [[7, "desc"]], //默认排序
                    deleteUrl:"@Url.Action("Delete")",
                    ajaxUrl: "@Url.Action("ForGrid")",
                        "columns": [
                         CONSTANT.DATA_TABLES.COLUMN.CHECKBOX("SerialRuleId")
                              , {

                                  "name": "SerialRuleId",
                                  "data": "SerialRuleId",
                                  "title": " 编号",
                                  "sDefaultContent": "",
                                  "type": 'string',
                                  "format": '',
                                  "bSortable": true,
                                  "className":"text-left"

                              }
                               , {

                                   "name": "Remark",
                                   "data": "Remark",
                                   "title": " 描述",
                                   "sDefaultContent": "",
                                   "type": 'string',
                                   "format": '',
                                   "bSortable": true

                               }
	                            ,{

                                    "name": "SerialPrefix",
                                    "data":"SerialPrefix",
                                    "title": " 前缀",
                                   "sDefaultContent": "",
                                    "type": 'string',
                                    "format":'',
                                    "bSortable":true

                                   }

	                            ,{

                                    "name": "SerialSuffix",
                                    "data":"SerialSuffix",
                                    "title": " 后缀",
                                   "sDefaultContent": "",
                                    "type": 'string',
                                    "format":'',
                                    "bSortable":true

                                   }

	                            ,{

                                    "name": "SerialLength",
                                    "data":"SerialLength",
                                    "title": " 长度",
                                   "sDefaultContent": "",
                                    "type": 'int',
                                    "format":'',
                                    "bSortable":true
                                    ,render: function (data, type, row)
                                    {
                                        return row.SerialLength;
                                    }


                                   }
                                    
	                            ,{

                                    "name": "SerialCount",
                                    "data":"SerialCount",
                                    "title": " 计数器",
                                   "sDefaultContent": "",
                                    "type": 'int',
                                    "format":'',
                                    "bSortable":true
                                    ,render: function (data, type, row)
                                    {
                                        return row.SerialCount;
                                    }
	                            },
                                CONSTANT.DATA_TABLES.COLUMN.LASTMODIFYDATE


                        , CONSTANT.DATA_TABLES.COLUMN.ACTIONBTN("SerialRuleId", "@Url.Action("Edit")")
                        ],
                        /*
                 * 向服务器传递的参数
                 */
                        "fnServerParams": function(data) {
                                        data.keyWord = $("#keyWord").val();
                                    }
                                });

                            });


    </script>
}
